package com.chenfy.everysound.entity

import com.chenfy.everysound.util.md5
import java.lang.StringBuilder

object SoundData {
    lateinit var soundEntity: List<SoundEntity>
}

data class SoundEntity(val label: String, val data: List<SoundItem>)
data class SoundItem(val name: String, val img: String, val sound: List<String>) {
    val id
        get() = sound.makeId()
}

// 根据SoundList生成ID
fun List<String>.makeId(): String {
    val sb = StringBuilder()
    forEach { it ->
        sb.append(it)
    }
    return sb.toString().md5()
}